package com.joey.cloud.psn.business.service.impl;

import com.joey.cloud.psn.business.entity.SysGroup;
import com.joey.cloud.psn.business.mapper.SysGroupMapper;
import com.joey.cloud.psn.business.service.ISysGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 组织架构 服务实现类
 * </p>
 *
 * @author Joey
 * @since 2021-03-19
 */
@Service
public class SysGroupServiceImpl extends ServiceImpl<SysGroupMapper, SysGroup> implements ISysGroupService {

    @Override
    public Set<String> buildGroupKeySet(List<SysGroup> groupList) {
        Set<String> groupKeySet = new HashSet<>();
        if(groupList!=null&&groupList.size()>0){
            for(SysGroup group:groupList){
                groupKeySet.add(group.getGroupKey());
            }
        }
        return groupKeySet;
    }
}
